#include <stdio.h>
#include <stdlib.h>
#include <math.h> 
#include <unistd.h>
#include "zbrent.h"
#include "cm.h"

double delta=200;
double deltal=100;

void usage(void)
{
	fprintf(stderr,"Usage: cm [-i <input overdensity>] [-o <output overdensity>] < [input file] > [output file] \ncm 1.0 - Use NFW profile for converting mass concentrations pairs from one overdensity to another.\n\nOptions: \n\t-i : Set the input overdensity, the default value is 200\n\t-o : Set the output overdensity, the default value is 100\n\t-h : Show this help\n\nData are read from stdin and sent to stdout.\n"); 
}

int main(int argc, char *argv[])
{

	int s;

	while ((s = getopt(argc, argv, "i:o:h")) != -1) 
	{
		switch(s) {
			case 'i':
				delta=atof(optarg);
				break;
			case 'o':
				deltal=atof(optarg);
				break;
			case 'h':
				usage();
				exit(0);
			case ':':
				exit(1);
			case '?':
				exit(1);
		}
	}
	
	convertcm();
	
	return 0;
}
